package com.dlc.shop.service;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dlc.shop.bean.model.Supplier;
import com.dlc.shop.bean.vo.SupplierVO;
import com.dlc.shop.common.util.PageParam;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 *
 *
 * @author SJL
 * @date 2020-08-25 15:50:06
 */
public interface SupplierService extends IService<Supplier> {

    /**
     * 供应商分页
     * @param page
     * @param supplier
     * @return
     */
    IPage<Supplier> pageShop(PageParam<Supplier> page, Supplier supplier);

    /**
     * 供应商商品分页
     * @param page
     * @param supplier
     * @return
     */
    IPage<SupplierVO> pageProdSupplier(PageParam<Supplier> page, Supplier supplier);

    /**
     * 导出供应商
     * @param supplier
     * @param response
     */
    void exportSupplier(Supplier supplier, HttpServletResponse response);

    /**
     * 下载模板
     * @param response
     * @param shopId
     */
    void downLoadModel(Long shopId,HttpServletResponse response);

    /**
     * 导入供应商
     * @param file
     * @param shopId
     * @return
     * @throws Exception
     */
    Object parseFile(MultipartFile file, Long shopId) throws Exception;

    /**
     * 根据供应商名称获取数量
     * @param supplierName
     * @param supplierId
     * @param shopId
     * @return
     */
    Integer getCountByName(String supplierName,Long supplierId,Long shopId);

    /**
     * 获取店铺供应商列表
     * @param shopId 店铺id
     * @return 供应商列表
     */
    List<Supplier> getByShopId(Long shopId);

    /**
     * 更新供应商
     * @param supplier
     * @return
     */
    boolean updateSupplier(Supplier supplier);

    /**
     * 供应商分类禁用后，清掉对应供应商的分类信息
     * @param supplierCategoryId
     */
    void updateSupplierByCategoryId(Long supplierCategoryId);
}
